<template>
	<view>
		<z-nav-bar ref="navBar" backState="2000" :scrollTop="scrollTop" transparentFixedFontColor="#FFF" type="transparentFixed" title="我的">
			<view class="pl16 transparent_fixed_preview" slot="transparentFixedLeft" @click="toMsg">
				<uni-icons type="chat" size="22" color="white"></uni-icons>
			</view>
			<view class="pl16 preview" slot="left" @click="toMsg">
				<uni-icons type="chat" size="22"></uni-icons>
			</view> 
		</z-nav-bar>
		<!-- 公共组件-每个页面必须引入 -->
		<!--<public-module></public-module>-->
		<my-header/>
		<base-banner :banners="myBanners" small/>
		<base-menu :menus="oftenFeatures" small :iconSize='24' title="常用功能" :column="4" :row-height="88"/>
		<view class="mt24">
			<base-menu :menus="otherFeatures" small :iconSize='24' title="其他功能" :column="4" :row-height="88"/>
		</view>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
import myHeader from './components/myHeader.vue'
import baseBanner from '@/components/base-banner/base-banner.vue'
export default {
	components:{
		myHeader,
		baseBanner
	},
	data() {
		return {
			scrollTop:0
		};
	},
	onLoad(e) {
		// 监听事件  
		// uni.$on('login',(userInfo)=>{ 
		// 	console.log(userInfo)
		//     let {avatarUrl,userName,token,isLogin} = userInfo
		// 	this.userName = userName
		// })  
	},
	onUnload() {
		// 移除监听事件  
		// uni.$off('login');  
	},
	onShow() {
		
	},
	computed:{
		...mapState(['myBanners','oftenFeatures','otherFeatures'])
	},
	//方法
	methods: {
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		onPageJump(url) {
			uni.navigateTo({
				url: url
			});
		},
		toMsg(){
			uni.showToast({
				title:'跳转消息',
				icon:'none'
			})
		}
	},
	//页面下来刷新
	onPullDownRefresh() {},
	//页面上拉触底
	onReachBottom() {},
	//用户点击分享
	onShareAppMessage(e) {
		return this.wxShare();
	}
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.blue-box{
	height: 150vh;
	background-color: red;
}
</style>
